package com.gzedu.common.util;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.InputStream;
import java.net.URL;
import java.util.Properties;

import org.springframework.stereotype.Repository;

@Repository
public class PropertyUtil {
	
	public static String readProperty(String key){
		String val = null;
		 try{
		    	Properties prop = new Properties();
		        //读取属性文件a.properties
		        InputStream in = PropertyUtil.class.getClassLoader().getResourceAsStream("/config.properties");
		        prop.load(in);     ///加载属性列表
		        System.out.println(key+":"+prop.getProperty(key));
		        val = prop.getProperty(key);
		        in.close();
		        
		  }catch(Exception e){
			  e.printStackTrace();
		        System.out.println(e);
		  }
		 return val;
	}
   
}
